
<div class="spage-main-box">
    <{if $order}>
        <{if $order.is_has_remote_pdts!=='true'}>
            <{include file="admin/order/order_edit.html"}>
        <{elseif $order.is_has_remote_pdts=='true'}>

            <{include file="admin/order/edit_po.html"}>

        <{/if}>
	<{else}>
        <{include file="admin/order/detail/detail.html"}>
    <{/if}>
    <center style="color:#333" >tips:只能修改收货人信息哦</center>
</div>

<script>
	//只能收货人信息被修改
	//所有select框设置disabled
	var selects = document.getElementsByTagName('select');
	var count = selects.length;
	for (var i = 0; i < selects.length-3; i++) {
		selects[i].disabled = true;
	};

	//所有input框设置readonly
	var inputs = document.getElementsByTagName('input');
	for (var i = 0; i < inputs.length; i++) {
		inputs[i].readOnly = true;
	};

	//将需要修改的释放
	var editinputs = document.getElementById('order_edit_receiver').getElementsByTagName('input');
	for (var i = 0;i<editinputs.length;i++) {
		editinputs[i].readOnly = false;
	};

	//覆盖删除商品的方法
	function delgoods(){}


subOrderForm = function (event,sign){
		//清除所有select框设置..当属性设置为"disabled"时,提交表单时,select的值无法传递,提交前移除disabled属性
		var selects = document.getElementsByTagName('select');
		var count = selects.length;
		for (var i = 0; i < selects.length-3; i++) {
			selects[i].disabled = false;
		};
	   var target={};
	   switch (sign){
			case 1:                    //保存不关闭
				$extend(target,{
					onComplete:function(){
						if(window.opener.finderGroup&&window.opener.finderGroup['<{$env.get.finder_id}>'])
						window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
						window.location.reload();
					}}
				);
			break;
			case 2:                   //保存关闭
				$extend(target,{
					onComplete:function(){
						if(window.opener.finderGroup&&window.opener.finderGroup['<{$env.get.finder_id}>'])
						window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
						window.close();
					}}
				);
			break;
	   }
	    var _form=$('orderEdit');
		if(!_form)return;
		var _formActionURL=_form.get('action');

		_form.store('target',target);
        _form.set('action',_formActionURL+'&but='+sign).fireEvent('submit',new Event(event));
    };
</script>

<{capture name='footbar'}>
<{assign var="message" value=$___b2c='确定退出?'|t:'b2c'}>
<{assign var="closelabel" value='关  闭'}>
<table cellspacing="0" cellpadding="0" style="margin:0 auto; width:100%" class="table-action">
      <tbody><tr valign="middle">
        <td>
            <{button label=$___b2c='保存并关闭'|t:'b2c' class="btn-primary" onclick="subOrderForm(event,2)"}>
            <{button label=$___b2c='保存当前'|t:'b2c' class="btn-primary" onclick="subOrderForm(event,1)"}>
			<{button label=$___b2c=$closelabel|t:'b2c' class="btn-secondary" onclick="if(confirm('{$message}'))window.close()"}>
        </td>
        </tr>
        </tbody></table>
<{/capture}>
